package com.youku.plugins.controlbarV4.view.components
{
   import flash.display.Sprite;
   import flash.display.Shape;
   import com.youku.plugins.controlbarV4.ControlBarConstant;
   import com.youku.utils.DrawUtil;
   
   public class ControlBarBG extends Sprite
   {
      
      public function ControlBarBG(param1:Number, param2:Number, param3:Number = 1, param4:Boolean = false) {
         super();
         this._border = DrawUtil.Rectangle(0,0,100,40,param2,1,null,0);
         this._inner = DrawUtil.Rectangle(0,0,100,39,param1,1,null,0);
         this._blackShape = DrawUtil.Rectangle(0,0,100,40,ControlBarConstant.BG_BLACK_COLOR,1,null,0);
         this._blackShape.visible = false;
         addChild(this._border);
         addChild(this._inner);
         addChild(this._blackShape);
         this._mask = DrawUtil.Rectangle(0,0,100,40,0,0,null,0);
         addChild(this._mask);
         this.mask = this._mask;
      }
      
      private var _border:Shape;
      
      private var _inner:Shape;
      
      private var _blackShape:Shape;
      
      private var _mask:Shape;
      
      override public function set width(param1:Number) : void {
         if(param1 == 0)
         {
            return;
         }
         this._border.width = param1;
         this._inner.width = param1;
         this._blackShape.width = param1;
         this._mask.width = param1;
         this.mask = this._mask;
      }
      
      public function setStyle(param1:String) : void {
         switch(param1)
         {
            case ControlBarConstant.CONTROLBAR_STYLE_LIGHT:
               this._blackShape.visible = false;
               break;
            case ControlBarConstant.CONTROLBAR_STYLE_DARK:
               this._blackShape.visible = true;
               break;
         }
      }
   }
}
